package com.multi.thread.chapter04.demo07;

public class RunFair {
	
	public static void main(String[] args) {
		final Service service = new Service(true);
		Runnable run = new Runnable() {
			
			@Override
			public void run() {
				System.out.println("★线程" + Thread.currentThread().getName() + "运行了!");
				service.serviceMethod();
			}
		};
		Thread[] thread = new Thread[10];
		for (int i = 0; i < 10; i++) {
			thread[i] = new Thread(run);
			thread[i].start();
		}
	}

}
